package Server.Timp;

import java.util.Vector;

import org.apache.mina.core.session.IoSession;

public class Sarcina {
	private Vector<String> vDate;
	private static int i = 0;
	private long timpStart;
	
	public Sarcina(long timpStart, Vector<String>vDate){
		this.vDate = vDate;
		this.timpStart = timpStart;
	}
	
	public void Afisare(IoSession session){
		i++;
		//System.out.println("Sesiunea cu id-ul: " + session.getId());
		//System.out.println(i +" ... " + ((System.currentTimeMillis() - timpStart)/1000) + " secunde de la pornire... " + vDate.get(i));
		session.write(i +" ... " + ((System.currentTimeMillis() - timpStart)/1000) + " secunde de la pornire... " + vDate.get(i)+"\n");
		session.resumeWrite();
		System.out.println("am trimis la client... lastWriteTime: " + session.getLastWriteTime());
	}

}
